/**
 * 
 */
package neptune.web.client.view.components.editor;

import neptune.web.client.model.topology.SerializableNode;
import neptune.web.client.model.topology.SerializableTopology;

import com.google.gwt.user.client.ui.MenuBar;
import com.google.gwt.user.client.ui.MenuItem;
import com.google.gwt.user.client.ui.TreeItem;

/**
 * @author Roberto Bifulco [info@RobertoBifulco.it] [RobertoBifulco.it]
 * 
 */
public class InterfacesMenuBar extends MenuBar {

	private MenuItem rootItem;

	public InterfacesMenuBar(SerializableNode node,
			SerializableTopology topology, TreeItem item) {
		super(false);

		MenuItem addNi = new MenuItem("Add NetInterface", new AddNetIFCommand(
				node, topology, item));

		MenuBar options = new MenuBar(true);

		options.addItem(addNi);

		rootItem = new MenuItem("Interfaces", options);
		addItem(rootItem);
		options.setStylePrimaryName("TopologyEditor-tree-NodeItem");
		this.setStylePrimaryName("TopologyEditor-tree-RootNodeItem");
	}

	/**
	 * @return the rootItem
	 */
	public MenuItem getRootItem() {
		return rootItem;
	}

}
